# svc
---
apiVersion: v1
kind: Service
metadata:
  name: kafka-zoo-svc
  namespace: spark-cluster
  labels:
    app: kafka
    component: kafka-zoo
spec:
  type: NodePort
  ports:
  - name: client
    port: 2181
    protocol: TCP
    nodePort: 30181
  - name: follower
    port: 2888
    protocol: TCP
    nodePort: 30288
  - name: leader
    port: 3888
    protocol: TCP
    nodePort: 30388
  - name: ssh
    port: 22
    protocol: TCP
  selector:
    app: kafka
    component: kafka-zoo

# rc
---
apiVersion: v1
kind: ReplicationController
metadata:
  labels:
    app: kafka
    component: kafka-zoo
  name: kafka-zoo
  namespace: spark-cluster
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: kafka
        component: kafka-zoo
    spec:
      containers:
      - name: zoo
        image: index.tenxcloud.com/zhangshun/zookeeper:3.4.9
        ports:
        - containerPort: 2181
        - containerPort: 22
        env:
        - name: ZOOKEEPER_ID
          value: "1"
        - name: ZOOKEEPER_SERVER_1
          value: kafka-zoo-svc
        volumeMounts:
        - mountPath: /opt/zookeeper-3.4.9/data
          name: rta-zoo
        resources:
          requests:
            cpu: 100m
      volumes:
        - name: rta-zoo
          glusterfs:
            endpoints: glusterfs-cluster
            path: {{ gluster_rta_zoo_volname }}
            readOnly: false
    
